﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="TrangChu.aspx.cs" Inherits="WebBanThuoc.TrangChu" %>
<asp:Content ID="Content_main" ContentPlaceHolderID="main" runat="server">
     <div align="center" class="imageRotate">
         <embed id="rotator" width="580" height="230" flashvars="file=imagerotator/imagerotator.xml&shuffle=false&width=580&height=230&linkfromdisplay=false&shownavigation=false&effect=fold" 
                allowfullscreen="true" quality="high" name="rotator" wmode="transparent"  src="imagerotator/imagerotator.swf"
               type="application/x-shockwave-flash">
        </embed>
      </div>
       <% System.Collections.Generic.List<WebBanThuoc.DTO.SanPham> TC_listSP = Session["TC_listSP"] as System.Collections.Generic.List<WebBanThuoc.DTO.SanPham>; %>
      <% if (TC_listSP.Count > 0)
         { %>
           <div class="middle_title" align="left"><h1>Sản phẩm mới</h1></div>
      <% } %>
       <asp:DataList ID="dl_products" runat="server" RepeatDirection="Horizontal" 
              HorizontalAlign="Left" CellPadding="2" 
               CellSpacing="1" EditItemStyle-VerticalAlign="Top" 
               CaptionAlign="Left" RepeatLayout="Table" RepeatColumns="3"
               style="float:left; width:606px;  margin-left:10px;">
        <ItemTemplate>
         <div class="border_newproduct">
           <div>
             <a href="CTSanPham.aspx?maSanPham=<%#Eval("MaSanPham")%>"><img src="<%#Eval("CachDung")%>" alt='No Picture' style='height:115px; max-width:140px;' /></a>
           </div>
          <label style="height:35px; padding:3px;">
            <a title="<%#Eval("TenSanPham")%>" href="CTSanPham.aspx?maSanPham=<%#Eval("MaSanPham")%>">
               <%#Eval("TenSanPham")%>
            </a>
          </label>
        <span>
            <div> <%#double.Parse(Eval("GiaDaGiam").ToString()) != double.Parse(Eval("GiaBan").ToString()) ? "<font>" + Eval("GiaBan", "{0:#,0.##}") + "&nbsp;VNĐ</font><br/>" : "<span>" + Eval("GiaBan", "{0:#,0.##}") + "&nbsp;VNĐ</span><br/>"%></div>
            <span> <%#double.Parse(Eval("GiaDaGiam").ToString()) == double.Parse(Eval("GiaBan").ToString()) ? "<font></font><br/>" : Eval("GiaDaGiam", "{0:#,0.##}") + "&nbsp;VNĐ"%></span>
         </span>
         <div class="btn_product">
          
            <span  class="form_search_button" style="margin-left:25px" > 
                <a href="CTSanPham.aspx?maSanPham=<%#Eval("MaSanPham")%>"><%#Eval("CoHang").ToString() =="True" ? "Mua hàng" : "Đặt hàng"%></a>
           
            </span>
          </div>
    </div> <!--border_newproduct-->
  </ItemTemplate>
  </asp:DataList>
 <!--</div>--><!-- end of middle_contentmodule-->
 
    <!--bắt đầu trang -->
    <div class="paging">
    
     <%int tc_tongSoTrang = Session["tc_tongSoTrang"] != null ? Convert.ToInt32(Session["tc_tongSoTrang"]) : 0;//tongSoTrang có sản phẩm trả về
          for (int i = 1; i <= tc_tongSoTrang; i++)
          { %>
            <a href="TrangChu.aspx?trang=<%=i %>"> <span class='page'><%= i %></span></a>
          <%} %>
    </div> 
        <!--kết thúc trang -->
     <%Session.Remove("TC_listSP");
      Session.Remove("tc_tongSoTrang"); %>

</asp:Content>
